home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
EDUCATE
/
PERFECT.ARJ
/
PERFECT.DOC
next >
Wrap
Text File
|
1991-12-01
|
7KB
|
167 lines
══════ ═══════ ══════ ═══════ ═══════ ═════ ══════ (R)
══ ══ ══ ═ ══ ══ ══ ═ ══ ═ ══ ═ ═ ══ ═
══ ══ ══ ══ ══ ══ ══ ══ ══
═════ ════ ═════ ════ ════ ══ ══
══ ══ ════ ══ ══ ══ ══
══ ══ ═ ══ ══ ══ ══ ═ ══ ═ ══
═══ ═══════ ═══ ══ ════ ══════ ═════ ════
P E R F E C T b y H e x / 2 9 A
(C) Copyright 1990-1991
HK SQUARE INC.
24-16 Steinway Str. Suit 580
L.I.C., NY 11103-3612
This is Version 1.0 of PERFECT. The program is written to be
compatible with clone BIOSs and PC/MS-DOS 5.xx. It will run on any
PC/XT/AT/386 or 486.
Special thanks to Mr. Bill Kambouroglou for the fast algorithm.
Enjoy it!
Hex/29A
PROGRAM / PROGRAMMER / DATE:
════════════════════════════
PERFECT.EXE / Ioannis "Hex/29A" Hadjiioannou / Dec 1st 1991.
DISTRIBUTION:
═════════════
PERFECT.EXE is a user supported program. It is now and will
always remain the sole property of the author. This program may be
freely distributed as long as the following limitations are adhered to:
1. THE PROGRAM AND DOCUMENTATION MAY NOT BE MODIFIED.
2. THE ENTIRE DOCUMENTATION FILE MUST BE INCLUDED WITH THE
PROGRAM.
3. THE AUTHOR'S COPYRIGHT NOTICE IS NOT TO BE REMOVED.
4. NO FEE FOR THE PROGRAM MAY BE CHARGED OUTSIDE OF A
REASONABLE CHARGE FOR DISKETTE MEDIA AND/OR SHIPPING.
($2.50 MAX).
5. IT MAY NOT BE PACKAGED OR SOLD IN CONJUNCTION WITH ANY
OTHER PRODUCT.
6. DISTRIBUTION OF THESE FILES (PERFECT.EXE AND
PERFECT.DOC), USING THE COMPRESSION PROGRAM "ARC" BY
SYSTEM ENHANCEMENT ASSOCIATES INC (SEA), IS STRICTLY
PROHIBITED.
NOTE: Shareware Houses and User Groups can distribute PERFECT
with other programs as long as they register one (1)
copy and obtain authorization from the author. See
REGISTRATION/CONTRIBUTION.
WARRANTY:
═════════
THE PROGRAM AND DOCUMENTATION IS SUPPLIED AS-IS AND THE AUTHOR
DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
LIMITATION, THE WARRANTIES OF MERCHANTABILITY AND THE WARRANTIES OF
FITNESS FOR ANY PURPOSE. THE AUTHOR FURTHER RESERVES THE RIGHT TO MAKE
CHANGES TO THE PROGRAM OR DOCUMENTATION WITHOUT OBLIGATION TO NOTIFY
ANY PERSON OR ORGANIZATION OF SUCH CHANGES.
FORMAT:
═══════
Just type PERFECT on the command line.
PURPOSE:
════════
PERFECT was developed for those who want to find if a specific
number is a PERFECT number or not. In order for a number to be a
PERFECT number, the sum of its divisors must be equal to the number.
For example 6 is a perfect number. Its divisors are 1, 2 and 3. 1+2+3
= 6. Also 28 is a PERFECT number. Its divisors are: 1, 2, 4, 7 and
14. 1+2+4+7+14 = 28.
PERFECT can also find all the PERFECT numbers in a given range.
HOW IT WORKS:
═════════════
After executing PERFECT you will be presented with an option menu:
F1 will check only one number, F2 will search for all PERFECT numbers
in a given range and F3 will quit the program.
By pressing F1 you will be asked to enter the number that you want
to check. After entering the number the program will check if that
number is a PERFECT number or not.
By pressing F2 you will be asked to enter the lower and upper
limit of the range that you want to check. After that the program will
display the lower and upper limit along with the number currently
checked at the top of your screen. The date and time that the search
was started will also be shown. Each PERFECT number that is found will
be displayed along with the date and time until the specified range is
covered. At that point, the date and time that the search has ended
will also be displayed.
PERFECT has a range between 0 and 2,147,483,647. Numbers outside
this range will not be accepted and you will be notified.
PERFECT uses two algorithms to accomplish its goal: The first
algorithm is used in the F1 option (check one number). It uses the
assumption that all PERFECT numbers end with a 6 or a 28. If this
condition is met, then the algorithm will try to divide the number in
question with all numbers between 2 and its square root keeping track
of all the divisors. If the sum of the divisors is equal to the number
then that number is a PERFECT number.
The second algorithm is used in the F2 option (check a range). It
was suggested by Mr. Bill Kambouroglou and its so fast that it will
take the first algorithm more time to check if 2,147,483,628 is a
PERFECT number than the second algorithm to find ALL PERFECT numbers
between 0 and 2,147,483,628. This algorithm is based on the assumption
that all PERFECT numbers have the following form:
n n-1
IF P = (2 -1) * 2 AND
n
(2 -1) is a PRIME number THEN
P is a PERFECT number.
If enough interest is generated by this program, I will re-write
it so that it can handle PERFECT numbers that are more that a thousand
digits long.
INSTALLATION:
═════════════
No special installation is required.
ERROR MESSAGES:
═══════════════
None.
REGISTRATION/CONTRIBUTION:
══════════════════════════
If you receive this program from another user or download it from
your local BBS and find it of value, your $10 contribution will be
appreciated. Please send comments and suggestions to:
HK SQUARE INC.
Ioannis Hadjiioannou
24-16 Steinway Str. Suit 580
L.I.C., NY 11103-3612
U.S.A.